package DocCangAPI;

public class LengthDemo {
    public static void main(String[] args) {
        String str="Thinking in Java是一本好书";
        System.out.println(str.length());
        System.out.println(str.charAt(20));

        int count=0;
        for (int i = 0; i < str.length(); i++) {
            char c=str.charAt(i);
            if(c=='n'){
                count++;
            }
        }
        System.out.println(count);
    }
}
